package com.example.baserecyclerviewadapterdemo.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.baserecyclerviewadapterdemo.R;
import com.example.baserecyclerviewadapterdemo.entity.MultiItemAdapterEntity;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

public class MultiItemEntityAdapter extends BaseQuickAdapter<MultiItemAdapterEntity, BaseViewHolder> {
    public MultiItemEntityAdapter(@Nullable List<MultiItemAdapterEntity> data) {
        super(R.layout.adapter_multi_item, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, MultiItemAdapterEntity item) {
        holder.setImageResource(R.id.imageView,item.getImageResource());
        holder.setText(R.id.tv_title,item.getTitle());
        holder.setText(R.id.tv_content,item.getContent());
    }
}
